import Vue from "vue";
import Router from "vue-router";

Vue.use(Router);

export default new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes: [
    {
      path: "/",
      redirect: "/contact"
    },
    {
      path: "/login",
      name: "login",
      component: () => import("@/views/login/login.vue")
    },
    {
      path: "/main",
      name: "main",
      component: () => import("@/views/main.vue"),
      children: [
        {
          path: "/home",
          name: "home",
          component: () => import("@/views/home/home.vue")
        },
        {
          path: "/order",
          name: "order",
          component: () => import("@/views/order/order.vue")
        },
        {
          path: "/contact",
          name: "contact",
          component: () => import("@/views/contact/contact.vue")
        },
        {
          path: "/help",
          name: "help",
          component: () => import("@/views/help/help.vue")
        }
      ]
    }
  ]
});
